import request from '@/api/request'

const base = '/job';

export function ReadPrediction_results1Hdfs() {
  return request({
    url: base + '/ReadPrediction_results1Hdfs',
    method: 'get',
  })
}

export function ReadPrediction_results2Hdfs() {
  return request({
    url: base + '/ReadPrediction_results2Hdfs',
    method: 'get',
  })
}

export function getWordCut() {
  return request({
    url: base + '/getWordCut',
    method: 'get',
  })
}

export function ReadCloudHdfs() {
  return request({
    url: base + '/ReadCloudHdfs',
    method: 'get',
  })
}

export function ReadByLevel(level) {
  return request({
    url: base + '/ReadByLevel',
    method: 'get',
    params: { level }
  })
}

export function get(data){
  return request({
    url: base + '/get',
    method: 'get',
    params: data
  })
}

export function paperGet(data){
  return request({
    url: base + '/paperGet',
    method: 'get',
    params: data
  })
}

//获取“热门推荐”试题，返回的是不按题型分类的热门试题数据
export function getHot() {
  return request({
    url: base + '/getHot',
    method: 'get',
  })
}

//获取按题型分类的热门推荐试题
export function getHotByType() {
  return request({
    url: base + '/hot_by_type',
    method: 'get'
  })
}

// 获取根据用户推荐的试题
export function getGRNNRecommend(userId) {
  return request({
    url: base + '/grnn_recommend',
    method: 'get',
    params: { userId }
  })
}

export function getChart1() {
  return request({
    url: base + '/getChart1',
    method: 'get',
  })
}


export function getAreaChart() {
  return request({
    url: base + '/getAreaChart',
    method: 'get',
  })
}

export function getChart2() {
  return request({
    url: base + '/getChart2',
    method: 'get',
  })
}


export function getChart3() {
  return request({
    url: base + '/getChart3',
    method: 'get',
  })
}

export function getNationRank() {
  return request({
    url: base + '/getNationRank',
    method: 'get',
  })
}

export function getMapData() {
  return request({
    url: base + '/getMapData',
    method: 'get',
  })
}

export function getTypeRate() {
  return request({
    url: base + '/getTypeRate',
    method: 'get',
  })
}


export function getTimeLine() {
  return request({
    url: base + '/getTimeLine',
    method: 'get',
  })
}

// 获取统计数字
export function getPanel() {
  return request({
    url: base + '/getPanel',
    method: 'get',
  })
}

// 按照省份分组统计
export function getCityJob() {
  return request({
    url: base + '/getCityJob',
    method: 'get',
  })
}

// 按照城市分组统计
export function getCityJob2() {
  return request({
    url: base + '/getCityJob2',
    method: 'get',
  })
}

// 按照公司类型分组统计
export function getTypeRank() {
  return request({
    url: base + '/getTypeRank',
    method: 'get',
  })
}
// 按照公司类型分组统计(知识图谱）
export function getGraphData() {
  return request({
    url: base + '/getGraphData',
    method: 'get',
  })
}

// 按照学历需求类型分组统计
export function getDegreeRank() {
  return request({
    url: base + '/getDegreeRank',
    method: 'get',
  })
}

// 词频统计- yearly_pos_frequency
export function ReadYearlyPosFrequencyHdfs() {
  return request({
    url: base + '/ReadYearlyPosFrequencyHdfs',
    method: 'get',
  })
}
// 词频统计 - pie_chart_results
export function ReadPieChartResultsHdfs() {
  return request({
    url: base + '/ReadPieChartResultsHdfs',
    method: 'get',
  })
}

export function chat(prompt, headers) {
  return request({
    url: base +'/chat',  // 这里需要确保基础路径正确
    method: 'post',
    data: { prompt: prompt },  // 移除了 headers 参数，它不应该在请求体中
    headers: headers  // 如果需要 headers，应该放在这里
  })
}